limsEquiptRepair.searchPage = {

    getGridParam: function () {
        var _this = this;
        return {
            type: 'grid',
            id: 'lims-equipt-repair-search-list-grid',
            url: limsEquiptRepair.baseUrl + '/queries/searchable',
            columns: limsEquiptRepair.getSearchListColumns(),
            onCellClick: function (field, row) {
                field === 'ext$.equiptcode' && _this.loadDetailPage(row.id);
            }
        }
    },

    create: function () {
        var _this = this;
        Gikam.create('layout', {
            id: 'lims-equipt-repair-search-list-layout',
            renderTo: workspace.window.$dom,
            center: {
                items: [this.getGridParam()]
            }
        });
    },

    loadDetailPage: function (id) {
        workspace.window.load(limsEquiptRepair.baseUrl + '/page/detail' + Gikam.param({
            id: id,
            page: 'search',
        }));
    },

    init: function () {
        this.create();
    }
};
